package com.jiangruan.javaApiProject.service;

import bean.FunnyPeople;
import bean.FunnyPeopleCommon;
import com.alibaba.fastjson.JSONObject;
import com.jiangruan.javaApiProject.Constants;
import com.jiangruan.javaApiProject.net.HttpUtils;

import java.util.List;

/**
 * @Author 默
 * @Date 19:26 2021/12/5
 * @desc
 * @Description
 */
public class FunnyPeopleService {

    public static List<FunnyPeople>  getFunnyPeople(){
        String url = Constants.TRIP_URL
                + "?key=" + Constants.TRIP_KEY
                + "&type=amusement_overall"
                + "&size=0";

        String result = HttpUtils.get(url);

        //对搞笑达人榜进行JSON
        FunnyPeopleCommon funnyPeopleCommon = JSONObject.parseObject(result, FunnyPeopleCommon.class);

        return funnyPeopleCommon.result;
    }
}
